import http from "@/utils/request";
 
// 获取合同列表
export const getContractList = async (pageSize, pageNo) => {
	return http.get<any>(`/contract/app/get-contract-list`, {pageSize:pageSize,pageNo:pageNo})
}

//查询单个合同 
export const getContractDetail = async (id:number) => {
	return http.get<any>(`/contract/app/get-contract-detail`, {id:id})
}

//获取合同签约地址
export const getContractSign = async (id:number,phone:number) => {
	return http.get<any>(`/contract/app/sign`, {contractId:id, phone:phone})
}

//获取下载电子合同
export const downLoadElectronic = async (id:number) => {
	return http.get<any>(`/contract/app/get-electronic-contract`, {contractId:id})
}

//合同申请列表
export const getContractApplyList = async (pageSize, pageNo) => {
	return http.get<any>(`/contract/contract-apply/page`, {pageSize:pageSize,pageNo:pageNo})
}

//合同申请续租 退租 延期 
export const getContractApply = async (data) => {
	return http.post<any>(`/contract/contract-apply/apply`, data)
}

//获取合同申请详情 
export const getContractApplyDeatil = async (id) => {
	return http.post<any>(`/contract/contract-apply/get?id=${id}`, {})
}

//修改合同申请详情 
export const editContractApplyDeatil = async (data) => {
	return http.post<any>(`/contract/contract-apply/update`, data)
}

//撤销合同申请详情 
export const cancelContractApplyDeatil = async (id) => {
	return http.post<any>(`/contract/contract-apply/revoke?id=${id}`, {})
}

//获取入住交房
export const stayContractGet = async (id) => {
	return http.get<any>('/contract/app/stay/get', {id:id})
}

//确认交房
export const confirmContractGet = async (id) => {
	return http.get<any>('/contract/app/stay/confirm', {id:id})
}

//根据登录人id获取房间
export const getRoomIdsById = async (data) => {
	return http.get<any>('/contract/app/get-roomIds', data)
}



// 获取业主合同列表
export const getLandlordContractList = async (pageSize, pageNo) => {
	return http.get<any>(`/contract/app/owner/page-owner-contract`, {pageSize:pageSize,pageNo:pageNo})
}

//查询业主单个合同 
export const getLandlordContractDetail = async (id:number) => {
	return http.get<any>(`/contract/app/owner/get-owner-contract`, {id:id})
}

//获取业主合同签约地址
export const getLandlordContractSign = async (id:number,phone:number) => {
	return http.get<any>(`/contract/app/owner-sign`, {contractId:id, phone:phone})
}

//获取下载电子业主合同
export const downLoadLandlordElectronic = async (id:number) => {
	return http.get<any>(`/contract/app/owner/get-own-electronic-contract`, {contractId:id})
}
